<div class="easyui-layout" data-options="fit:true,border:false">
    <div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
        <table class="easyui-datagrid" style="width:300px;height:300px" data-options="fitColumns:true">
            <thead>
            <tr>
                <th data-options="field:'code',width:150">用户名</th>
                <th data-options="field:'name',width:150,align:'center'">操作</th>
            </tr>
            </thead>
            <tbody>
            #for(user:userList)
            <tr>
                <td>#(user.username)</td>
                <td>
                    #hasPermission("user:offUser")
                        <a onclick="offUser('#(user.username)')" class="fa  fa-power-off">下线</a>
                    #end
                </td>
            </tr>
            #end
            </tbody>
        </table>
    </div>
</div>
<script>
    function offUser(username) {
        $.get('#(ctx)/admin/user/offUser/' + username, function (response) {
            parent.$.messager.alert('提示', response.msg, 'info');
            parent.$.modalDialog.handler.dialog('refresh');
        }, 'JSON');
    }
</script>